<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <a-tabs default-active-key="1" >
      <a-tab-pane v-for="pane in panes" :key="pane.id" :tab="pane.name" >
        <assessment-projects-items-list :project_type="pane.projectId" :classification_id="pane.id"></assessment-projects-items-list>
      </a-tab-pane>

    </a-tabs>
  </a-card>
</template>

<script>

  import '@/assets/less/TableExpand.less'

  import AssessmentProjectsItemsList from '@views/gfxy/manage/AssessmentProjectsItemsList.vue'
  import { getAction } from '@api/manage'

  export default {
    name: 'AssessmentProjectsItemsSub',
    props:{
      projectType: {
        type:String,
        required:true
      }
    },
    components: {
      AssessmentProjectsItemsList
    },

    data () {
      return {
        dictOptions:{},
        superFieldList:[],
        url:{
          list: '/assessmentProjectsClassification/list'
        },
        panes:[]
      }
    },
    created() {
      this.getTitles();
    },
    computed: {

    },
    methods: {
      initDictConfig(){
      },
      getTitles(){
        this.loading = true;
        let queryParam= {
          projectId : this.projectType
        };
        let isorter={
          column: 'orderNum',
            order: 'asc',
        };
        let param = Object.assign(queryParam, isorter);

        getAction(this.url.list, param).then((res) => {

          if (res.success) {

            this.panes = res.result.records||res.result;
            // if(res.result.total)
            // {
            //   this.ipagination.total = res.result.total;
            // }else{
            //   this.ipagination.total = 0;
            // }
            //update-end---author:zhangyafei    Date:20201118  for：适配不分页的数据列表------------
          }
          if(res.code===510){
            this.$message.warning(res.message)
          }
          console.log(this.panes)
          this.loading = false;
        });

        // this.panes = [
        //   {
        //     item_text:'职工年度考核',
        //     item_value:'1',
        //   },{
        //     item_text:'核心指标考核',
        //     item_value:'2',
        //   }
        // ]
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>